Skip to content

feat(python): add async client (grpc.aio) - #2645

Draft
dhirajsb wants to merge 1 commit into
NVIDIA:mainfrom
dhirajsb:feat/async-client-rebased
Draft

feat(python): add async client (grpc.aio)#2645
dhirajsb wants to merge 1 commit into
NVIDIA:mainfrom
dhirajsb:feat/async-client-rebased

Conversation

@dhirajsb

@dhirajsb dhirajsb commented Aug 6, 2026

Copy link
Copy Markdown

Summary

Add an asyncio-native Python SDK surface built on grpc.aio for applications that cannot block their event loop or rely on thread-pool wrappers. The async clients mirror the current synchronous sandbox, workspace, and inference-route APIs while leaving all sync behavior unchanged.

Related Issue

Closes #1820

Changes

  • Add AsyncSandboxClient, AsyncSandboxSession, and the high-level AsyncSandbox context manager.
  • Add async sandbox CRUD, waits, command streaming, exec, and exec_python with workspace identity preserved across lifecycle operations.
  • Add AsyncWorkspaceClient and workspace-scoped AsyncInferenceRouteClient.
  • Reuse current TLS, active-gateway resolution, OIDC refresh, and bearer authentication through grpc.aio interceptors for every RPC shape.
  • Export the async SDK types and document asyncio usage.
  • Add async unit coverage for execution, authentication, workspace routing, inference routes, lifecycle operations, and context management.

Testing

  • mise run pre-commit passes
  • mise run python:typecheck passes
  • mise run test:python (120 tests)
  • Unit tests added/updated
  • E2E tests added/updated (not applicable; the async transport and public surface are covered with in-process fake gRPC stubs)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (not applicable; user-facing documentation updated)

Add asyncio-native sandbox, workspace, and inference-route clients that mirror the current synchronous Python SDK using grpc.aio.

Preserve workspace identity across sandbox CRUD, sessions, waits, and high-level context management. Reuse the existing TLS and OIDC refresh plumbing, including async interceptors for every RPC shape.

Document the async surface and add unit coverage for execution, authentication, workspace routing, inference routes, lifecycle operations, and context management.

Signed-off-by: Dhiraj Bokde <dbokde@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add asyncio client using grpc.aio

1 participant